<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/echarts.js"></script>
	</head>
	<body>
		<script type="text/javascript">
			require.config({
				paths:{
					echarts:'./js'
				}
			});
			require(
				 [
                'echarts',
                'echarts/chart/line',   // 按需加载所需图表，如需动态类型切换功能，别忘了同时加载相应图表
                'echarts/chart/pie'
                ],
             	function (ec){
             		var myChart = ec.init(document.getElementById('main'));
             		var option = {
             			  	tooltip : {
//						        trigger: 'item',
						        formatter: "{a} <br/>{b} : {c} ({d}%)"
    						},
						    legend: {
//						        orient : 'vertical',
						        x : 'left',
						        data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
						    },
						    toolbox: {
						        show : false,
						        feature : {
						            mark : {show: false},
						            dataView : {show: false, readOnly: false},
						            magicType : {
						                show: false, 
						                type: ['pie', 'funnel'],
						                option: {
						                    funnel: {
						                        x: '25%',
						                        width: '50%',
						                        funnelAlign: 'center',
						                        max: 1548
						                    }
						                }
						            },
						            restore : {show: false},
						            saveAsImage : {show: false}
						        }
						    },
						    calculable : false,
						    series : [
						        {
						            name:'访问来源',
						            type:'pie',
//						            radius : ['50%', '70%'],
									radius : '35%',
						            itemStyle : {
						                normal : {
						                    label : {
						                        show : false
						                    },
						                    labelLine : {
						                        show : false
						                    }
						                },
						                emphasis : {
						                    label : {
						                        show : false,
						                        position : 'center',
						                        textStyle : {
						                            fontSize : '30',
						                            fontWeight : 'bold'
						                        }
						                    }
						                }
						            },
						            data:[
						                {value:335, name:'直接访问'},
						                {value:310, name:'邮件营销'},
						                {value:234, name:'联盟广告'},
						                {value:135, name:'视频广告'},
						                {value:1548, name:'搜索引擎'}
						            ]
						        }
						    ]
             			
             		};
             		
             	myChart.setOption(option);	
             		
             	}
			);
			
		</script>
		
		<div id="main" style="height: 500px;"></div>
	</body>
</html>
